package com.funymmz.demo.aop;


import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.annotation.AfterReturning;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

@Component
@Aspect
@Slf4j
public class HttpAspect {
    @Pointcut("execution(public * com.funymmz.demo.webapi.UserRestController.get(..))")
    public void setLog(){}

    @AfterReturning(returning = "object", pointcut = "setLog()")
    public void After(Object object){
        log.info("response:{}", object);
        //System.out.println("日志输出");
    }
}
